package com.tornado.system.service;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tornado.system.mapper.OrderMapper;
import com.tornado.system.model.Orders;

@Service
public class orderService implements IorderService {
	
	@Autowired
	private OrderMapper orderMapper;

	
	

	//管理员查询订单列表
	public List<Orders> orderList() {
		//List<Order> orderList=orderMapper.getOrder();
		return orderMapper.getOrder();
	}
	
	
	//会员查询订单列表
	public List<Orders> orderList2(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	//管理员查询订单列表(通过订单号)
	public List<Orders> orderListByOrderId(String Oid) {
		
		return orderMapper.orderListByOrderId(Oid);
	}
	

	//管理员查询订单列表(通过用户id)
	public List<Orders> orderListByUserId(Integer uid) {
		
		
		return orderMapper.orderListByUserId(uid);
	}
	
	//管理员查询订单列表(通过订单号和用户id)
	public  List<Orders> orderListByOrderIdUserId(String Oid,Integer uid){
		HashMap<String, Object> params=new HashMap<String, Object>();
		params.put("Oid", Oid);
		params.put("uid", uid);
		
		return orderMapper.orderListByOrderIdUserId(params);
	}

}
